<template>
  <div>
    <h1>用户详情</h1>
    <p>用户 ID: {{ userId }}</p>
  </div>
</template>

<script>
import { useRoute } from 'vue-router';

export default {
  name: 'User',
  setup() {
    const route = useRoute();
    const userId = route.params.id; // 获取动态参数
    return { userId };
  },
};
</script>